<?xml version="1.0" encoding="UTF-8"?>
<%@ page contentType="text/xml;charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ page import="com.tomato.dao.*"%>
<%@ page import="com.tomato.bean.*"%>
<%@ page import="com.tomato.servlet.*"%>
<%@ page import="java.util.*"%> 
<%@ page import = "javax.jdo.*"%>
<%@ page import = "com.google.appengine.api.datastore.Blob"%>

<data> 
<%	
	request.setCharacterEncoding("utf-8");
	Long id = null;
	Ebook ebook;
	List<Ebook> list = new ArrayList();
	String str = request.getParameter("key");
	String[] st = str.split("/");
	for(int i = 0; i < st.length; i++) {
		id = Long.parseLong(st[i]);
		ebook = EbookDao.getInstance().getById(id);
		list.add(ebook);
	}	
	for(Ebook ebooks : list) {
		byte[] b = ebooks.getEbook().getBytes();
		String text = new String(b,"utf-8");
%> 
<lists>
	<id><%=ebooks.getId()%></id> 
	<genre><%=ebooks.getGenre()%></genre>
	<title><%=ebooks.getTitle()%></title>
	<author><%=ebooks.getAuthor()%></author>	
	<description><%=ebooks.getDescription()%></description>
	<ebook><%=text %></ebook>
	<count><%=ebooks.getCount()%></count>
	<date><%=ebooks.getDate()%></date>
</lists> 
<%
 	}
%> 
</data>
